/*! 
 * Header file for a gravity force generator.
 *
 * \author Devis Rossini
 * \date 19 March 2012
 */ 
#ifndef PHXGRAVITYFORCEGENERATOR_H_INCLUDE_GUARD
#define PHXGRAVITYFORCEGENERATOR_H_INCLUDE_GUARD

#include "PhxCore.h"
#include "PhxForceGenerator.h"

namespace phx
{
	/*!
     * A force generator that applies a gravitational force. 
	 *
	 * \note One instance can be used for multiple rigid bodies.
     */
    class Gravity : public ForceGenerator
	{
    public:

        /*! Creates the generator with the given acceleration. */
        Gravity(const Vector3& gravity);

        /*! Applies the gravitational force to the given rigid body. */
        virtual void UpdateForce(RigidBody* body, real duration);

	private:

		/*! Holds the acceleration due to gravity. */
		Vector3 mGravity;
	};
}

#endif // PHXGRAVITYFORCEGENERATOR_H_INCLUDE_GUARD